package com.wangsd.common.component.extBean;

import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;

/**
 * 分账查询（返回）
 */
@XStreamAlias("xml")
public class PaymentQueryResponse extends BaseWxPayResult {
    @XStreamAlias("transaction_id")
    private String transactionId;
    @XStreamAlias("out_order_no")
    private String outOrderNo;
    @XStreamAlias("order_id")
    private String orderId;
    @XStreamAlias("status")
    private String status;
    @XStreamAlias("close_reason")
    private String closeReason;
    @XStreamAlias("receivers")
    private String receivers;
    @XStreamAlias("amount")
    private String amount;
    @XStreamAlias("description")
    private String description;

    public static PaymentQueryResponse fromXML(String xmlString) {
        XStream xstream = XStreamInitializer.getInstance();
        xstream.allowTypesByWildcard(new String[]{"me.chanjar.weixin.**",
                "cn.binarywang.wx.**", "com.github.binarywang.**",
                "com.wangsd.common.component.**"});
        xstream.processAnnotations(PaymentQueryResponse.class);
        PaymentQueryResponse result = (PaymentQueryResponse) xstream.fromXML(xmlString);
        result.setXmlString(xmlString);
        return result;
    }


    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCloseReason() {
        return closeReason;
    }

    public void setCloseReason(String closeReason) {
        this.closeReason = closeReason;
    }

    public String getReceivers() {
        return receivers;
    }

    public void setReceivers(String receivers) {
        this.receivers = receivers;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
